package zjut.cocouml.command;

import org.eclipse.draw2d.geometry.Rectangle;

import zjut.cocouml.model.BClass;
import zjut.cocouml.model.Compartment;

public class CompartmentChangeLayoutCommand extends AbstractLayoutCommand{

	private Compartment model;
	private Rectangle layout;
	private Rectangle oldLayout;
	
	public void execute() {
		model.setLayout(layout);
	}
	
	public void setConstraint(Rectangle rect) {
		this.layout = rect;
	}

	public void setModel(Object obj) {
		// TODO Auto-generated method stub
		this.model = (Compartment)obj;
		this.oldLayout= ((Compartment)obj).getLayout();
	}
	public void undo() {
		this.model.setLayout(this.oldLayout);
	}
	
}
